Skip to content

docs: explain warning-filter imports before coverage starts - #776

Open
AdityaSreevatsaK wants to merge 2 commits into
pytest-dev:masterfrom
AdityaSreevatsaK:docs/437-warning-filter-early-imports
Open

AdityaSreevatsaK wants to merge 2 commits into
pytest-dev:masterfrom
AdityaSreevatsaK:docs/437-warning-filter-early-imports

Conversation

@AdityaSreevatsaK

Copy link
Copy Markdown

Summary

Document why pytest warning filters referencing a package's warning class can import that package before pytest-cov starts measuring coverage.

Extend docs/plugins.rst with the limitation, examples and the coverage run -m pytest workaround.

Refs #437.

Verification

  • Reproduced 0% import-time coverage with pytest-cov and 100% using the documented workaround.
  • Verified both command-line and configuration-file warning filters.
  • Fork CI: 29 jobs passed, including all test matrix jobs.
  • Sphinx HTML documentation build passed. External link checking failed on pre-existing unrelated 404/502 links.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant